package com.kang.leasewang.controller;

import com.kang.leasewang.entity.User;
import com.kang.leasewang.result.Result;
import com.kang.leasewang.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("getUser")
    public Result<User> getUser() {
        User byId = userService.getById(1);
        return Result.ok(byId);
    }
}
